import axios from '@/libs/api.request'

const prefix = '/web/analysisReport'
const analysisReportApi = {
  trainDetailSportsRecord(sportsRecord) {
    return axios.request({
      url: prefix + '/trainDetailSportsRecord',
      data: sportsRecord,
      method: 'post'
    })
  },
  querySportsRecordPageResult(sportsRecord) {
    return axios.request({
      url: prefix + '/sportsRecordPageResult',
      data: sportsRecord,
      method: 'post'
    })
  },
  exportTrainRecordExcel(sportsRecord) {
    return axios.request({
      url: prefix + '/exportTrainRecordExcel',
      data: sportsRecord,
      method: 'post',
      responseType: 'blob'
    })
  },
  queryGroupAnalysisReport(sportsRecordId) {
    return axios.request({
      url: prefix + '/report/' + sportsRecordId,
      method: 'get'
    })
  },
  queryTrainDetailAnalysisReport(data) {
    return axios.request({
      url: prefix + '/report/trainDetail',
      data: data,
      method: 'post'
    })
  },
  queryFreetrainAnalysisReport(sportsRecordId) {
    return axios.request({
      url: prefix + '/freeTrainReport/' + sportsRecordId,
      method: 'get'
    })
  },
}

export default analysisReportApi
